import Vue from 'vue'
import Router from 'vue-router'
import pageLogin from '../page/login'
import pageRegister from '../page/register'
import pageInfo from '../page/personal_infomation'
import pageIndex from '../page/index'
import pageHome from '../page/home'
import pageDiscover from '../page/discover'
import pagePersonal from '../page/personal'
import pageContents from '../page/contents'
import pageExtend from '../page/extend'
import pageInitiate from '../page/initiate'
import pageContinue from '../page/continue'
import pagedemo from '../page/demo'
import pageFeedback from '../page/feedback'
import pageCollect from '../page/collect'
import pageFriendlist from '../page/friendlist'
import pageSetting from '../page/setting'
import pageComment from '../page/comment'
import pageHistory from '../page/history'
import pageMessage from '../page/message'

Vue.use(Router)

export default new Router({
	routes: [
		{
			path: '/',
			redirect: {
				name: 'index'
			}
		},
		{
			path: '/login',
			name: 'login',
			component: pageLogin
		},	
		{
			path: '/register',
			name: 'register',
			component: pageRegister
		},
		{
			path: '/info',
			name: 'info',
			component: pageInfo
		},
		{
			path: '/contents',
			name: 'contents',
			component: pageContents
		},
		{
			path: '/extend',
			name: 'extend',
			component: pageExtend
		},
		{
			path: '/initiate',
			name: 'initiate',
			component: pageInitiate
		},
		{
			path: '/continue',
			name: 'continue',
			component: pageContinue
		},
		{
			path: '/feedback',
			name: 'feedback',
			component: pageFeedback
		},
		{
			path: '/collect',
			name: 'collect',
			component: pageCollect
		},
		{
			path: '/friendlist',
			name: 'friendlist',
			component: pageFriendlist
		},
		{
			path: '/setting',
			name: 'setting',
			component: pageSetting
		},
		{
			path: '/comment',
			name: 'comment',
			component: pageComment
		},
		{
			path: '/history',
			name: 'history',
			component: pageHistory
		},
		{
			path: '/message',
			name: 'message',
			component: pageMessage
		},
		{
			path: '/index',
			name: 'index',
			component: pageIndex,
			redirect: {
				name: 'home'
			},
			children: [
				{
					path: 'home',
					name: 'home',
					component: pageHome
				},
				{
					path: 'discover',
					name: 'discover',
					component: pageDiscover
				},
				{
					path: 'personal',
					name: 'personal',
					component: pagePersonal
				},
			]
		}
	]
})
